import request from '@/utils/request'

export function listAdmin(query) {
  return request({
    url: '/admin/list',
    method: 'get',
    params: query
  })
}

export function createAdmin(data) {
  return request({
    url: '/admin/create',
    method: 'post',
    data
  })
}

export function readminAdmin(data) {
  return request({
    url: '/admin/readmin',
    method: 'get',
    data
  })
}

export function updateAdmin(data) {
  return request({
    url: '/admin/update',
    method: 'post',
    data
  })
}

export function deleteAdmin(data) {
  return request({
    url: '/admin/delete',
    method: 'post',
    data
  })
}

export function listRole(query) {
  return request({
    url: '/admin/role/list',
    method: 'get',
    params: query
  })
}

export function createRole(data) {
  return request({
    url: '/admin/role/create',
    method: 'post',
    data
  })
}

export function readRole(data) {
  return request({
    url: '/admin/role/readRole',
    method: 'get',
    data
  })
}

export function updateRole(data) {
  return request({
    url: '/admin/role/update',
    method: 'post',
    data
  })
}

export function deleteRole(data) {
  return request({
    url: '/admin/role/delete',
    method: 'post',
    data
  })
}

export function listMenu() {
  return request({
    url: '/admin/menu/list',
    method: 'get'
  })
}

export function createMenu(data) {
  return request({
    url: '/admin/menu/create',
    method: 'post',
    data
  })
}

export function readMenu(data) {
  return request({
    url: '/admin/menu/readMenu',
    method: 'get',
    data
  })
}

export function updateMenu(data) {
  return request({
    url: '/admin/menu/update',
    method: 'post',
    data
  })
}

export function deleteMenu(data) {
  return request({
    url: '/admin/menu/delete',
    method: 'post',
    data
  })
}
